<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Visual C++ gotchas in VMD</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.10">
<link rel="up" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.10">
<link rel="prev" href="vmd_dynamic_typing.html" title="Input as dynamic types">
<link rel="next" href="vmd_conv.html" title="Version 1.7 to 1.8 conversion">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="vmd_dynamic_typing.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_conv.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="variadic_macro_data.vmd_vc_isms"></a><a class="link" href="vmd_vc_isms.html" title="Visual C++ gotchas in VMD">Visual C++ gotchas in
    VMD</a>
</h2></div></div></div>
<p>
      I have discussed throughout the documentation areas of VMD which need to be
      considered when using Microsoft's Visual C++ compilers with its default preprocessor.
      The VMD library supports VC++ versions 8 through the latest 14.2. These correspond
      to Visual Studio 2005 through the current Visual Studio 2019.
    </p>
<p>
      I will give here fairly briefly the VC++ quirks which should be taken into
      account when using VMD. These quirks exist because the VC++ compiler does not
      have a C++ standard conforming preprocessor with its default preprocessor.
      More specifically the VC++ compiler does not follow all of the rules correctly
      for expanding a macro when a macro is invoked. Here is a list for things to
      consider when using VMD with VC++ and its default preprocessor:
    </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
          The BOOST_VMD_IS_EMPTY macro will expand erroneously to 1 if the input
          resolves to a function-like macro name, which when it is called with an
          empty parameter expands to a tuple.
        </li>
<li class="listitem">
          The BOOST_VMD_ASSERT macro, and the corresponding individual VMD ASSERT
          macros for the various data types, do not cause an immediate compiler error,
          but instead generate invalid C++ if the ASSERT occurs.
        </li>
<li class="listitem">
          When the BOOST_VMD_ASSERT macro, or one of the corresponding individual
          VMD ASSERT macros for the various data types, does not generate an error,
          and the macro in which it is being used does generate some output, it is
          necessary to use BOOST_PP_CAT to concatenate the empty result of the VMD
          ASSERT macro with the normally generated output to correctly generate the
          final expansion of the macro in which the VMD ASSERT occurs.
        </li>
<li class="listitem">
          When using BOOST_VMD_EMPTY following some non-empty expansion, or when
          using BOOST_VMD_IDENTITY, the value returned needs to be concatenated using
          BOOST_PP_CAT with an empty value. You can use BOOST_VMD_IDENTITY_RESULT
          to accomplish this transparently.
        </li>
<li class="listitem">
          Avoid using an empty parenthesis to pass no data as a tuple or seq if VC++8
          might be used as the compiler.
        </li>
</ul></div>
<p>
      When using VC++ with its new standard conforming preprocessor, which as of
      now is not its default preprocessor in Visual Studio 2019, none of these problems
      manifest themselves.
    </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2010-2017 Tropic Software
      East Inc</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="vmd_dynamic_typing.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_conv.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
